﻿using StudentMgmt.SQLServerDAL;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace StudentMgmt
{
    public partial class frmMain : Form
    {
        public frmMain()
        {

            InitializeComponent();
            Student student = new Student();
            DataTable myTable = new DataTable();

            int val = student.QueryStudent(out myTable);

            if (val == 1 && myTable.Rows.Count > 0)
            {
                this.dataGridView1.DataSource = myTable;
            }
            this.StartPosition = FormStartPosition.CenterScreen;
        }

        private void menuItemNewStudent_Click(object sender, EventArgs e)
        {
            frmNewStudent objFrmNewStudent = new frmNewStudent();
            objFrmNewStudent.Show();
        }

        private void menuItemSearchStudent_Click(object sender, EventArgs e)
        {
            frmUserList objFrmUserList = new frmUserList();
            objFrmUserList.Show();
        }

        private void menuItemChangeStudent_Click(object sender, EventArgs e)
        {
            frmStuInfoChange objFrmNewChange = new frmStuInfoChange();
            objFrmNewChange.Show();
        }

        private void menuItemRewardStudent_Click(object sender, EventArgs e)
        {
            frmNewReward objFrmNewReward = new frmNewReward();
            objFrmNewReward.Show();
        }

        private void menuItemPunishmentStudent_Click(object sender, EventArgs e)
        {
            frmNewPunishment objFrmNewPunishment = new frmNewPunishment();
            objFrmNewPunishment.Show();
        }

        private void menuItemNewChange_Click(object sender, EventArgs e)
        {
            frmNewChange objFrmNewChange = new frmNewChange();
            objFrmNewChange.Show();
        }

       
    }
}
